<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>外边距</title>
</head>
<body>
<style>
    #div1{
        width: 200px;
        height: 200px;
        border: 10px solid red;
    }
    #div2{
        width: 200px;
        height: 200px;
        border: 20px solid blue;
        margin-top:50px ; /*外边框到外边框的距离 外边距*/
        margin-left: 100px;
    }
</style>
<div id="div1">

</div>
<div id="div2">

</div>
</body>
</html>